const Koa = require('koa');
const bodyParser = require('koa-bodyparser');
const logger=require('./app/middleware/logger');
const router = require('./app/router');
const mount = require('koa-mount');
const server=require('koa-static')
const cors=require('koa-cors')
const path=require('path')
const pull=path.join(__dirname,'app','pull')
const auth=require('./app/middleware/auth')
const app = new Koa();

app.use(bodyParser())
app.use(mount('/myweb',server(pull)))
app.use(cors({origin:"*"}))
app.use(logger())
app.use(auth())
app.use(router)

app.listen(3009,()=>{
console.log("http://localhost:3009");
});